<?php
namespace Home\Controller;

class IndexController extends BaseController {


	public function index(){

		$this->assign('index','active');
		if(!$articles=S('articles')){
			$articles = M('article as b')
			->where('a_view > 0')
			->order('a_time desc')
			->join('__TAG__ as a on a.t_id = b.pid')
			->limit(0,6)
			//->fetchSql(true)
			->select();
			setS("articles", $articles);
		}

		$this->articles=$articles;
		if(!$ppt=S('ppt')){
			$ppt = M('ppt')
			->where(array("pp_view"=>1))
			->order("pp_time desc")
			->limit(3)
			->select();
			setS("ppt", $ppt);
		}
		$this->ppt = $ppt;
		$this->display();

	}


}